<template>
	<view class="conten">
		<navbar title="会场设计" :back="true" color="#fff" leftIconColor="#fff"></navbar>
		<view style="padding: 0 20rpx 20rpx 20rpx;background-color: #f5f5f5;">
			<view style="background-color: #fff;padding: 20rpx;border-radius: 20rpx;margin-top: 20rpx;">
				 <view style="display: flex;justify-content: space-between;align-items: center;">
					 <view style="display: flex;align-items: center;">
					 	<view style="margin-left:10rpx;margin-right:6rpx;font-weight: 700;font-size: 26rpx;">会场名称</view>
					 	<view style="color:rgba(166, 29, 36, 1);font-size: 42rpx;height: 38rpx;margin-left: 6rpx;">*</view>
					 </view>
					 <view style="padding: 10rpx 20rpx;width:78%;background-color:#fff;border-radius: 10rpx;box-sizing: border-box;" class="input">
					 	  <u-input placeholder="请输入会场名称" border="none" v-model="params.name" placeholderStyle='color:rgba(187, 187, 187, 1);font-size: 26rpx' color='#000' fontSize='13px'></u-input>
					 </view>
				 </view>
			</view>
			<view style="padding:20rpx;background-color: #fff;border-radius: 20rpx;margin-top: 20rpx;">
				<view style="display: flex;align-items: center;justify-content: space-between;">
					 <view style="display: flex;align-items: center;">
						 <view style="margin-left: 12rpx;font-weight: 700;font-size: 26rpx;">会议地址</view>
						 <view style="color:rgba(166, 29, 36, 1);font-size: 42rpx;height: 38rpx;margin-left: 6rpx;">*</view>
					  </view>				
					 <view style="font-size: 26rpx;display: flex;align-items: center;justify-content: space-between;background-color:#fff;border-radius: 10rpx;box-sizing: border-box;" >
						 <AddressPicker style="color:#000;font-size: 26rpx;width: 100%;"
							@change="change" :level="3">{{address}}</AddressPicker>
						  <view style="margin-left: 10rpx;">
							  <u-icon name="arrow-right" color="#000" size="14"></u-icon>
						  </view>
					 </view>
				</view>
			</view>
			<view style="padding:20rpx;background-color: #fff;border-radius: 20rpx;margin-top: 20rpx;">
				<view style="display: flex;align-items: center;">
					<view style="margin-left: 14rpx;font-weight: 700;font-size: 26rpx;">详细地址</view>
					<view style="color:rgba(166, 29, 36, 1);font-size: 42rpx;height: 38rpx;margin-left: 6rpx;">*</view>
				</view>
				<view style="margin-top: 20rpx;">
					<u-textarea v-model="params.address" :customStyle="{backgroundColor:'#f8f8f8',color:'#000',boxSizing: 'border-box',border:'2rpx solid #f2f2f2',height:'70px'}" placeholder="请输入详细地址" placeholderStyle='color:rgba(187, 187, 187, 1);font-size: 26rpx' autoHeight :count='true' maxlength='30' border='none'></u-textarea>
				</view>
			</view>
		
			<view style="text-align: center;margin:30rpx 0 60rpx 0;padding: 0 80rpx;">
				<view style="padding: 20rpx 0;background-color: #3277fc;color: #fff;border-radius:30rpx;font-size: 26rpx;text-align:center" @click="gui()">保存会场</view>
			</view>
			<u-popup :show="signShow" mode="center"  @close="signShow=false" :closeable='true' :closeOnClickOverlay='true' round='10' :customStyle="{width:'560rpx',height:'900rpx'}">
			        <view style="color: #000;margin-top: 24rpx;">
			            <view style="text-align: center;font-weight: 650;font-size: 32rpx;margin-bottom: 20rpx;">场地配置</view>
						<view style="padding: 0 40rpx;">
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
								<view style="margin-right: 24rpx;">场地名称</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入场地名称" border="none"  v-model="signObj.name" :placeholderClass="{}" color='#000' fontSize='13px'></u--input>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
								<view style="margin-left: 96rpx;margin-right: 24rpx;">长</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入场地长度" border="none" type='digit' v-model="signObj.length" :placeholderClass="{}" color='#000' fontSize='13px' suffixIcon='cm' :suffixIconStyle="{fontSize:'26rpx',color:'#999999'}"></u--input>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
								<view style="margin-left: 96rpx;margin-right: 24rpx;">宽</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入场地宽度" border="none" type='digit' v-model="signObj.width" :placeholderClass="{}" color='#000' fontSize='13px' suffixIcon='cm' :suffixIconStyle="{fontSize:'26rpx',color:'#999999'}"></u--input>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
								<view style="margin-left: 96rpx;margin-right: 24rpx;">高</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入场地高度" border="none" type='digit' v-model="signObj.height" :placeholderClass="{}" color='#000' fontSize='13px' suffixIcon='cm' :suffixIconStyle="{fontSize:'26rpx',color:'#999999'}"></u--input>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
								<view style="margin-right: 24rpx;width: 122rpx;text-align: center;">PPT高</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入PPT高" border="none" type='digit' v-model="signObj.pptHeight" :placeholderClass="{}" color='#000' fontSize='13px' suffixIcon='cm' :suffixIconStyle="{fontSize:'26rpx',color:'#999999'}"></u--input>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
								<view style="margin-right: 24rpx;width: 122rpx;text-align: center;">PPT宽</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入PPT宽" border="none" type='digit' v-model="signObj.pptWidth" :placeholderClass="{}" color='#000' fontSize='13px' suffixIcon='cm' :suffixIconStyle="{fontSize:'26rpx',color:'#999999'}"></u--input>
								</view>
							</view>
							<view style="width: 280rpx;margin: 0 auto;margin-top: 20rpx;">
								<u-button type="error" text="确认" @click='confirm'></u-button>
							</view>
						</view>
			        </view>
			</u-popup>
			<u-popup :show="addShow" mode="center"  @close="addShow=false" :closeable='true' :closeOnClickOverlay='true' round='10' :customStyle="{width:'560rpx',height:'560rpx'}">
			        <view style="color: #000;margin-top: 24rpx;">
			            <view style="text-align: center;font-weight: 650;font-size: 32rpx;margin-bottom: 20rpx;">场地规格配置</view>
						<view style="padding: 0 40rpx;">
							<view style="display: flex;align-items: center;justify-content: space-between;">
								<view style="display: flex;align-items: center;">
									<view style="color:rgba(166, 29, 36, 1);">*</view>
									<view style="margin-left: 28rpx;margin-right: 30rpx;">场地规格</view>
								</view>
								<view style="display: flex;align-items: center;" @click="add()">
									<u-icon name="plus-circle" color="red" size="18"></u-icon>
									<view style="font-size: 26rpx;margin-right: 6rpx;margin-left: 6rpx;">添加规格</view>
								</view>
							</view>
							<view v-if="signArea.length!=0" style="height:400rpx;overflow: scroll;">
								<view v-for="(item,index) in signArea" :key="index" style="border-bottom: 2rpx solid #ccc;padding: 20rpx 0;" v-if="show">
									<view class="">名称 : {{item.name}}</view>
									<view style="display: flex;justify-content:space-between;align-items: center;margin-top: 20rpx;flex-wrap: wrap;">
										<view class="">宽 : {{item.width}}cm</view>
										<view class="">高 : {{item.height}}cm</view>
										<view style="margin: 20rpx 0;">长 : {{item.length}}cm</view>
									</view>
									<view style="display: flex;justify-content:space-between;align-items: center;">
										<view class="">ppt宽 : {{item.pptWidth}}cm</view>
										<view class="">ppt高 : {{item.pptHeight}}cm</view>
									</view>
									<view style="border: 2rpx solid red;padding:8rpx 26rpx;border-radius: 20rpx;font-size: 22rpx;margin-top: 20rpx;width: 80rpx;text-align: center;" @click="delet(item.id)">删除</view>
								</view>
							</view>
						</view>
			        </view>
			</u-popup>
			<u-popup :show="menAShow" mode="center"  @close="menAShow=false" :closeable='true' :closeOnClickOverlay='true' round='10' :customStyle="{width:'560rpx',height:'560rpx'}">
			        <view style="color: #000;margin-top: 24rpx;">
			            <view style="text-align: center;font-weight: 650;font-size: 32rpx;margin-bottom: 20rpx;">门口签到区配置</view>
						<view style="padding: 0 40rpx;">
							<view style="display: flex;align-items: center;justify-content: space-between;">
								<view style="display: flex;align-items: center;">
									<view style="color:rgba(166, 29, 36, 1);">*</view>
									<view style="margin-left: 28rpx;margin-right: 30rpx;">签到区规格</view>
								</view>
								<view style="display: flex;align-items: center;" @click="menadd()">
									<u-icon name="plus-circle" color="red" size="18"></u-icon>
									<view style="font-size: 26rpx;margin-right: 6rpx;margin-left: 6rpx;">添加规格</view>
								</view>
							</view>
							<view v-if="menArea.length!=0" style="height:400rpx;overflow: scroll;">
								<view v-for="(item,index) in menArea" :key="index" style="border-bottom: 2rpx solid #ccc;padding: 20rpx 0;" v-if="ashow">
									<view class="">名称 : {{item.name}}</view>
									<view style="display: flex;justify-content:space-between;align-items: center;margin-top: 20rpx;flex-wrap: wrap;">
										<view class="">宽 : {{item.width}}cm</view>
										<view class="">高 : {{item.height}}cm</view>
										
									</view>
									
									<view style="border: 2rpx solid red;padding:8rpx 26rpx;border-radius: 20rpx;font-size: 22rpx;margin-top: 20rpx;width: 80rpx;text-align: center;" @click="adelet(item.id)">删除</view>
								</view>
							</view>
						</view>
			        </view>
			</u-popup>
			<u-popup :show="modShow" mode="center"  @close="modShow=false" :closeable='true' :closeOnClickOverlay='true' round='10' :customStyle="{width:'560rpx',height:'700rpx'}">
			        <view style="color: #000;margin-top: 24rpx;">
			            <view style="text-align: center;font-weight: 650;font-size: 32rpx;margin-bottom: 20rpx;">修改会场</view>
						<view style="padding: 0 40rpx;">
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
			
								<view style="margin-right: 30rpx;width: 160rpx;">会场名称</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:65%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入会场名称" border="none" v-model="mod.name" :placeholderClass="{}" color='#000' fontSize='13px'></u--input>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
						
								<view style="margin-right: 30rpx;width: 160rpx;">会议地址</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:65%;background-color:#f8f8f8;border-radius: 10rpx;font-size: 26rpx;">
									<AddressPicker style="color: #000;font-size: 26rpx;width: 100%;"
										@change="change1" :level="3">{{ads}}</AddressPicker>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);" v-if="ads!='请输入会议地址'">
							
								<view style="margin-right: 30rpx;width: 160rpx;">详细地址</view>
								<view class="textarea">
									<u-textarea v-model="mod.address" :customStyle="{backgroundColor:'#f8f8f8',color:'#000',boxSizing: 'border-box',border:'2rpx solid #f2f2f2'}" height='50px' placeholder="请输入会议详细地址" :placeholderClass='{}' :count='true' color='#000' ></u-textarea>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(255, 255, 255, .1);">
							
								<view style="margin-right: 30rpx;width: 160rpx;">是否启用</view>
								<u-switch v-model="m" size="22" @change="qchange"></u-switch>
							</view>
							<view style="text-align: center;margin-top: 30rpx;padding-bottom: 60rpx;">
								<view style="padding: 10rpx 0;display: inline-block;background-color: #1ea33b;color: #fff;border-radius:26rpx;font-size: 26rpx;width: 240rpx;text-align:center" @click="mods()">修改</view>
							</view>
						</view>
			        </view>
			</u-popup>
			<u-picker :show="upShow" :columns="upMlist" :closeOnClickOverlay='true'  @close='upShow=false' @confirm='MConfirm' @cancel='upShow=false'></u-picker>
			<u-popup :show="menShow" mode="center" zIdx='2000' zIndex='2000' @close="menShow=false" :closeable='true' :closeOnClickOverlay='true' round='10' :customStyle="{width:'560rpx',height:'560rpx'}">
			        <view style="color: #000;margin-top: 24rpx;">
			            <view style="text-align: center;font-weight: 650;font-size: 32rpx;margin-bottom: 20rpx;">门口签到区配置</view>
						<view style="padding: 0 40rpx;">
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(112, 112, 112,.1);">
								<view style="margin-left: 62rpx;margin-right: 24rpx;">类型</view>
								<view style="border: 2rpx solid #dadbde;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;display: flex;align-items: center;" class="input">
									  <u--input placeholder="请输入类型" border="none" placeholderStyle='color:#999999;font-size: 26rpx' v-model="menObj.name" color='#000' fontSize='13px'></u--input>
								      <view style="width: 30rpx;text-align: center;padding-left: 20rpx;" @click.stop="upShow=true">
								      	  <u-icon name="arrow-right" color="#000" size="12" ></u-icon>
								       </view>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(112, 112, 112,.1);">
								<view style="margin-left: 90rpx;margin-right: 24rpx;">宽</view>
								<view style="border: 2rpx solid #dadada;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入配置宽度" border="none" type='digit' v-model="menObj.width" :placeholderClass="{}" placeholderStyle='color:#999999;font-size: 26rpx' color='#000' fontSize='13px' suffixIcon='cm' :suffixIconStyle="{fontSize:'26rpx',color:'#999999'}"></u--input>
								</view>
							</view>
							<view style="display: flex;align-items: center;padding: 20rpx 0;border-bottom: 2rpx solid rgba(112, 112, 112,.1);">
								<view style="margin-left: 90rpx;margin-right: 24rpx;">高</view>
								<view style="border: 2rpx solid #dadada;padding: 10rpx 20rpx;width:58%;background-color:#f8f8f8;border-radius: 10rpx;" class="input">
									  <u--input placeholder="请输入配置高度" border="none" type='digit' v-model="menObj.height" placeholderStyle='color:#999999;font-size: 26rpx' color='#000' fontSize='13px' suffixIcon='cm' :suffixIconStyle="{fontSize:'26rpx',color:'#999999'}"></u--input>
								</view>
							</view>
							<view style="width: 280rpx;margin: 0 auto;margin-top: 20rpx;">
								<u-button type="error" text="确认" @click='confirm1'></u-button>
							</view>
						</view>
			        </view>
			</u-popup>
			<view v-if="list.length!=0">
				 <view v-for="(item,index) in list" :key="index" style="padding: 20rpx;background-color: #fff;border-radius: 20rpx;margin-top: 20rpx;">
				 	 <view style="display: flex;align-items: center;justify-content:space-between;padding-bottom: 20rpx;border-bottom: 2rpx solid #eee">
						<view style="margin-left: 18rpx;font-size: 28rpx;font-weight: 650;">{{item.name}}</view>
						 <view style="display: flex;align-items: center;">
							 <view style="margin-right: 20rpx;font-size: 22rpx;">是否开启</view>
							 <u-switch v-model="item.statue?true:false" size="22"></u-switch>
						 </view>
					 </view>
					 <view style="display: flex;margin: 20rpx 0;color:#999999;font-size: 28rpx;">
						 <view style="width: 90rpx;text-align: center;">地址:</view>
						 <view style="width: 90%;word-break: break-all;">{{item.province + item.city + item.district + item.address}}</view>
					 </view>
					
					 <view style="display: flex;align-items: center;margin:30rpx 0 20rpx 0;">
						 <view style="padding: 10rpx 0;display: inline-block;background-color:#3277fc;color: #fff;border-radius:26rpx;font-size: 26rpx;width: 180rpx;text-align:center" @click="ad(item.id)">添加规格</view>
						 <view style="padding: 10rpx 0;display: inline-block;background-color:#3277fc;color: #fff;border-radius:26rpx;font-size: 26rpx;width: 180rpx;text-align:center;margin: 0 20rpx;" @click="men(item.id)">签到区规格</view>
					 </view>
					 <view style="padding-top: 20rpx;border-top: 2rpx solid #eee;display: flex;align-items: center;justify-content: space-between;">
						 <view style="font-size: 24rpx;color:#999999;">其他操作</view>
						  <view style="display: flex;align-items: center;">
							  <view style="display: flex;align-items: center;" @click="del(item.id)">
								  <u-icon name="trash" color="#999999" size="22"></u-icon>
								  <view style="font-size: 24rpx;color:#999999;margin-left: 10rpx;">删除</view>
							  </view>
							  <view style="display: flex;align-items: center;margin-left: 40rpx;" @click="modify(item)">
								  <u-icon name="edit-pen" color="#999999" size="22"></u-icon>
								  <view style="font-size: 24rpx;color: #999999;margin-left: 10rpx;">修改</view>
							  </view>
						  </view>
					 </view>
					 <!-- 
					    <view style="padding: 10rpx 0;display: inline-block;background-color: red;color: #fff;border-radius:26rpx;font-size: 26rpx;width: 180rpx;text-align:center" @click="modify(item.id)">修改</view>
					    <view style="padding: 10rpx 0;display: inline-block;background-color: red;color: #fff;border-radius:26rpx;font-size: 26rpx;width: 180rpx;text-align:center;margin-left: 20rpx;" @click="del(item.id)">删除</view>
					  -->
				 </view>
			</view>
			<view class="" v-else>
				<u-empty
				        mode="list"
				        icon="http://cdn.uviewui.com/uview/empty/list.png"
						text='暂无会场'
				>
				</u-empty>
			</view>
		</view>
	</view>
</template>

<script>
	import navbar from "@/components/baseNavbar.vue"
	import {
		getbusiness,
		getbusList,
		getbusdel,
		getbusAdd,
		getbusinfoDel,
		getbusup,
		getbusinfoUp
	} from "@/api/make.js"
	import AddressPicker from '@/pages/sub/components/address-picker/AddressPicker.vue'
	export default{
		components:{
			navbar,
			AddressPicker
		},
		data(){
			return{
				address:'请输入会议地址',
				ads:'请输入会议地址',
				show:false,
				menShow:false,
				menAShow:false,
				ashow:false,
				upShow:false,
				list:[],
				upMlist:[['常规桁架签到墙','异型桁架签到墙','电子签到签']],
				page: {
					page: 1,
					limit: 10,
				},
				modShow:false,
				id:'',
				s:true,
				m:true,
				addShow:false,
				signArea:[],
				menArea:[],
				signShow:false,
				loadend: false,
				loading: false,
				signObj:{
					type:0,
					settingId:'',
					length:'',
					name:'',
					width:'',
					height:'',
					pptHeight:'',
					pptWidth:''
				},
				menObj:{
					type:1,
				  settingId:'',
				  name:'',
				  width:'',
				  height:''
				},
				params:{
					address:'',
					city:'',
					cityId:'',
					province:'',
					provinceId:'',
					district:'',
					districtId:'',
					name:'',
					statue:1,
				},
				mid:'',
				mod:{
					id:'',
					address:'',
					city:'',
					cityId:'',
					province:'',
					provinceId:'',
					district:'',
					districtId:'',
					name:'',
					statue:1,
				}
			}
		},
		onLoad(){
			this.resetList()
		},
		methods:{
			MConfirm(e){
				console.log('选择',e);
				this.menObj.name = e.value[0]
				this.upShow=false
			},
			modify(item){
				this.mod.id = item.id
				this.mod.address = item.address
				this.mod.city = item.city
				this.mod.cityId = item.cityId
				this.mod.province = item.province
				this.mod.provinceId = item.provinceId
				this.mod.district = item.district
				this.mod.districtId = item.districtId
				this.mod.name = item.name
				this.mod.statue = item.statue
				this.m = item.statue?true:false
				this.ads = this.mod.province+'-'+this.mod.city+'-'+this.mod.district
				this.modShow = true
			},
			mods(){
				console.log(this.mod);
				getbusup(this.mod).then(res=>{
					console.log('1111',res);
					if(res.code==200){
						uni.showToast({
							title:'修改成功',
							icon:'none'
						})
						this.modShow = false
						this.resetList()
					}
				})
			},
			adelet(id){
				getbusinfoDel({id,}).then(res=>{
					if(res.code==200){
						this.resetList()
						this.ashow = false
						uni.showToast({
							icon:'none',
							title:"删除成功"
						})
						let time = setInterval(()=>{
							let index = this.list.findIndex(item=>item.id==this.id)
							console.log(this.id);
							this.menArea = this.list[index].signInfoList
							if(!this.ashow){
								this.ashow = true
								clearInterval(time)
							}
						},200)
					}
				})
			},
			delet(id){
				getbusinfoDel({id,}).then(res=>{
					if(res.code==200){
						this.resetList()
						this.show = false
						uni.showToast({
							icon:'none',
							title:"删除成功"
						})
						let time = setInterval(()=>{
							let index = this.list.findIndex(item=>item.id==this.id)
							console.log(this.id);
							this.signArea = this.list[index].infoList
							if(!this.show){
								this.show = true
								clearInterval(time)
							}
						},200)
					}
				})
			},
			qchange(e){
               this.mod.statue = e?1:0
			   this.m = e
			},
			Schange(e){
			    this.params.statue = e?1:0
				this.s = e
				console.log('11',this.params.statue);
			},
			confirm1(){
				if(this.menObj.settingId){
					getbusAdd(this.menObj).then(res=>{
						if(res.code==200){
									this.resetList()
									this.ashow = false
									
									this.menObj.name = ''
									this.menObj.width =''
									this.menObj.height=''
									
									uni.showToast({
										icon:'none',
										title:"添加成功"
									})
									let time =setInterval(()=>{
										
										if(this.list.length!=0){
											this.menShow = false
											this.menAShow = true
											console.log('list',this.list);
											if(this.list.length!=0){
												let index = this.list.findIndex(item=>item.id==this.id)
												this.menArea = this.list[index].signInfoList
											}
											if(!this.ashow){
												this.ashow = true
												clearInterval(time);
											}
										}
									},200)
						         
								}
							})
						}
			},
			confirm(){
				if(this.signObj.settingId){
					
					getbusAdd(this.signObj).then(res=>{
						if(res.code==200){
							this.resetList()
							this.show = false
							this.signObj.length=''
							this.signObj.name = ''
							this.signObj.width =''
							this.signObj.height=''
							this.signObj.pptHeight = ''
							this.signObj.pptWidth = ''
							uni.showToast({
								icon:'none',
								title:"添加成功"
							})
                          let time =setInterval(()=>{
								this.signShow = false
								this.addShow = true
								console.log('list',this.list);
								if(this.list.length!=0){
									let index = this.list.findIndex(item=>item.id==this.id)
									this.signArea = this.list[index].infoList
									if(!this.show){
										this.show = true
										clearInterval(time);
									}
								}
							},200)
							console.log(this.show);
						}
					})
				}
			},
			ad(id){
				this.signObj.settingId = id
				this.id = id
				this.addShow=true
				let index = this.list.findIndex(item=>item.id==this.signObj.settingId)
				
				this.signArea = this.list[index].infoList
				this.show = true
			},
			men(id){
				this.menAShow =true
				this.menObj.settingId = id
				this.id = id
				let index = this.list.findIndex(item=>item.id==this.menObj.settingId)
				console.log('indfex',index);
				this.menArea = this.list[index].signInfoList
				this.ashow = true
			},
			add(){
				if(this.signObj.settingId){
					this.signShow=true;
					this.addShow=false
				}
			},
			menadd(){
				if(this.menObj.settingId){
					this.menShow=true;
					this.menAShow=false
				}
			},
			del(id){
				getbusdel({id,}).then(res=>{
					if(res.code==200){
						this.resetList()
					}
				})
			},
			resetList(callback){
				this.page.page = 1;
				this.loading = false
				this.loadend = false
				this.list = []
				this.getList(callback)
			},
			getList(callback) {
				if (this.loadend || this.loading)
					return
				this.loading = true
				getbusList(this.page).then(res => {
					this.page.page++
					this.$set(this, 'list', this.list.concat(res.data.list))
					this.loading = false
					if (!res.data.hasNextPage)
						this.loadend = true
					if (callback != undefined) {
						callback()
					}
				}).catch(err => {
					this.loading = false
					this.loadend = true
					if (callback != undefined) {
						callback()
					}
				})
			},
			gui(){
				if(this.params.address!=''&&this.params.name!=''){
					getbusiness(this.params).then(res=>{
						if(res.code==200){
							this.resetList()
						}
					})
				}else{
					uni.showToast({
						icon:'none',
						title:'请先填写名称和地址'
					})
				}
			},
			change1(result){
				console.log(JSON.stringify(result.data));
				let planLocate = '';
				result.data.forEach((item, index) => {
					if (index === 0) {
						planLocate += item.name
					} else {
						planLocate += '-' + item.name
					}
				});
				this.ads = planLocate
				this.mod.city = result.data[1].name
				this.mod.province = result.data[0].name
				this.mod.cityId = result.data[1].id
				this.mod.provinceId = result.data[0].id
				if (result.data.length == 3) {
					this.mod.district = result.data[2].name
					this.mod.districtId = result.data[2].id
				} else {
					this.mod.district = result.data[1].name
					this.mod.districtId = result.data[1].id
				}
				
			},
			change(result){
				console.log(JSON.stringify(result.data));
				let planLocate = '';
				result.data.forEach((item, index) => {
					if (index === 0) {
						planLocate += item.name
					} else {
						planLocate += '-' + item.name
					}
				});
				this.address = planLocate
				this.params.city = result.data[1].name
				this.params.province = result.data[0].name
				this.params.cityId = result.data[1].id
				this.params.provinceId = result.data[0].id
				if (result.data.length == 3) {
					this.params.district = result.data[2].name
					this.params.districtId = result.data[2].id
				} else {
					this.params.district = result.data[1].name
					this.params.districtId = result.data[1].id
				}
				
			},
		}
	}
</script>

<style lang="scss">
	page{
		height: 100%;
	}
</style>
<style lang="scss" scoped>
	/deep/.u-textarea.data-v-81cd9d32{
		background-color: #fff;
	}
	/deep/.u-upload__wrap__preview.data-v-49deb6f2{
		margin: 0;
	}
	/deep/.u-textarea__count.data-v-81cd9d32{
		background-color: transparent;
		color: #fff;
	}
	/deep/.u-textarea__field.data-v-81cd9d32{
		color: #fff;
		font-size: 26rpx;
	}
	/deep/.textarea .textarea-placeholder{
		font-size: 26rpx;
	}
	/deep/.input .input-placeholder{
		font-size: 26rpx;
	}
	.conten{
		background-color:#f6f6f6;
		height: 100%;
		padding-bottom: 40rpx;
	}
	.textarea{
		width: 71%;
	}
</style>